#ifndef SENDIMGMSG_H
#define SENDIMGMSG_H

#include <QThread>
#include <QQueue>
#include <QMutex>
#include <QImage>
#include <QVideoFrame>
#include <QWaitCondition>

class SendImgMsg : public QThread
{
    Q_OBJECT
public:
    explicit SendImgMsg(QObject *parent = nullptr);

    void pushToQueue(QImage);

public slots:
    void imageCapture(QImage);

    void clearImgQueue();

    void stopImmediately();

private:
    QQueue<QByteArray> m_imgQueue;
    QMutex m_queueLock;
    QWaitCondition m_queueWaitCond;
    QMutex m_lock;
    volatile bool m_isRun;

    void run() override;
};

#endif // SENDIMGMSG_H
